package com.example.service;

import com.example.config.AmqpConfig;
import org.springframework.amqp.rabbit.core.RabbitMessagingTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by Administrator on 2016/6/21.
 */
@Service
public class SendService {

    @Autowired
    RabbitMessagingTemplate rabbitMessagingTemplate;

    public void sendToRabbitmq(String message){
        this.rabbitMessagingTemplate.convertAndSend(AmqpConfig.EXCHANGE,AmqpConfig.ROUTINGKEY,message);
    }

}
